package com.biz.primus.model.oms.vo;

import com.biz.primus.model.oms.enums.OrderDeliveryType;
import com.biz.primus.model.oms.enums.OrderPaymentState;
import com.biz.primus.model.oms.enums.OrderState;
import com.biz.primus.model.oms.vo.returns.OmsReturnItemVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.FieldDefaults;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;

/**
 * @author LGJ
 * @date 2017/11/20
 */

@Getter
@Setter
@FieldDefaults(level = AccessLevel.PRIVATE)
@ApiModel("oms订单主体")
public class OmsOrderRespVo {

	@ApiModelProperty("订单编号")
	String orderCode;

	@ApiModelProperty("原订单号,订单拆分(split)之后,记录原始订单id,外部订单不传这个值")
	String sourceOrderCode;

	@ApiModelProperty("订单状态, 线上订单默认是begin(新订单),线下订单可以有其他状态")
	OrderState state;

	@ApiModelProperty("支付状态,如果支付状态为已支付(paid),应该将支付记录传过来(payments中)")
	OrderPaymentState paymentState;

	@ApiModelProperty(value="订单来源",allowableValues = "pos,ios,android,wechat")
	String orderSource;

	@ApiModelProperty("门店编号")
	String depotCode;

	@ApiModelProperty("门店名")
	String depotName;

	@ApiModelProperty("已清金额(已支付金额)")
	Integer paidAmount = 0;

	@ApiModelProperty("订单金额(已经抵扣了各类优惠券/促销的金额)")
	Integer orderAmount = 0;

	@ApiModelProperty("运费金额")
	Integer freightAmount = 0;

	@ApiModelProperty("各类优惠抵扣的金额总和")
	Integer discountAmount = 0;

	@ApiModelProperty("配送方式")
	OrderDeliveryType deliveryType;

	@ApiModelProperty(value="期望收货时间, 格式为yyyy-MM-dd HH:mm:ss, 用于立即送的场合", dataType = "java.lang.String")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	LocalDateTime expectedReceivingTime;

	@ApiModelProperty("创建时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	LocalDateTime createTimestamp;

	@ApiModelProperty("收货人信息")
	OmsConsigneeVo consignee;

	@ApiModelProperty("用户备注")
	String remark;

	@ApiModelProperty("客服备注")
	String selfRemark;

	@ApiModelProperty("订单项")
	List<OmsItemVo> items = Collections.emptyList();

	@ApiModelProperty("支付记录")
	List<OmsPaymentVo> payments = Collections.emptyList();

	@ApiModelProperty("用户账号")
	String  userAccountNumber;

	@ApiModelProperty("用户电话")
	String userMobile;

	@ApiModelProperty("用户名")
	String userName;

	@ApiModelProperty("用户等级")
	String userLevel;

	@ApiModelProperty("退单编码")
	String returnCode;

	@ApiModelProperty("退款编号")
	String refundCode;

	@ApiModelProperty("退款金额")
	Integer refundAmount;

	@ApiModelProperty("退款方式")
	String refundWays;

	@ApiModelProperty("退款状态")
	String refundState;

	@ApiModelProperty("退款创建时间")
	LocalDateTime refundCreateTime;

	@ApiModelProperty("退单商品明细")
	List<OmsReturnItemVo> omsReturnItemVos;

	@ApiModelProperty("下单员工编号,自有渠道才有, app下单没有")
	String operator;
}
